package rendava;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.*;
/**
 * A class to display images in the renderer.
 * @author Ben Gomm
 * @version 0.5
 */

public class Image extends SimpleTag 
{
	
	private int width;
	private int height;
	private String imgUrl;

	
	public void renderInfo(Renderer renderer)
	{
		ImageIcon image = new ImageIcon(imgUrl);
		JLabel label = new JLabel("Image", image, JLabel.CENTER);
		renderer.getCanvas().add(label);
	}
	
	public int getWidth()
	{
		return width;
	}
	
	public int getHeight()
	{
		return height;
	}
	
	public void seturl(String iurl)
	{
		String url = iurl;
		imgUrl = url;
		//System.out.println("Image URL set to " + imgURL);
		
	}
	
	public String closeTag()
	{
		return "close";
	}
}
